<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Business Application List</title>
<link href="table/style.css" rel="stylesheet" type="text/css" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />
<style type="text/css">
.style21 {font-weight: bold}
</style>
</head>
<body>
<div id="bg">
<div id="logo">
<img src="images/logo_and_name.png" alt="" width="305" height="78" />

 </div>
<div id="main">
<div id="out"><h3><p align="right"><a href="BPLS.php">Home</a>|&nbsp;&nbsp;<a href="logout.php">Logout</a></p></h3></div>
<!-- header begins -->
	<?php
if(isset($_GET['BID']))
{
$delete = $_GET['BID'];
echo "<script type=\"text/javascript\">
function show_confirm()
{
var r=confirm(\"Are you sure you want to delete this Permit Application?\");
if (r==true)
  {
  document.location.href=\"deleteBPApp.php?BID=$delete\";
  }

}
</script>";
}
?>
							
<script type="text/javascript" src="lib/jquery-1.4.3.min.js"></script>
    <script type="text/javascript" src="lib/jquery.nivo.slider.pack.js"></script>
    <script type="text/javascript">
    $(window).load(function() {
        $('#slider').nivoSlider();
    });
    </script>
    
    <style type="text/css" title="currentStyle">
			@import "css/demo_page.css";
			@import "css/demo_table_jui.css";
			@import "css/jquery-ui-1.8.4.custom.css";
			@import "css/TableTools_JUI.css";
	</style>
    
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" src="js/ZeroClipboard.js"></script>
<script type="text/javascript" charset="utf-8" src="js/TableTools.js"></script>
<script type="text/javascript" charset="utf-8">
			$(document).ready( function () {
				$('#example').dataTable( {
					"bJQueryUI": true,
					"sPaginationType": "full_numbers",
					} );
				$(".plastic").click(function(){
				var z = $(this).parent().attr('id');
				window.location = "add2.php?id="+z;
				}
				);
				
			} );
			
</script>
 
	

        <div id="buttons">
		<ul>
			<li class="first"><a href="BPLS.php"  title="">Home</a></li>
			   <li><a href="BPLS.php" title="Business Permit and Licensing System Module">BPLS</a></li>
			<li><a href="login3.php" title="Real Property Tax Module">RPT</a></li>
			<li><a href="UserList.php" title="">User List</a></li>
            <li><a href="userverify.php" title="">Verify User</a></li>
			<li><a href="#" title="">Contact</a></li>
		</ul></div>
<!-- header ends -->
<!-- content begins -->
<div id="content_bg">
  <div id="content_bg">
    
        <a href="bpApp.php">
   <img src="images/addrecord.png" title="add business" align="left" alt="" width="50" height="50" /></a>   <center>
                 <td height="36" colspan="4" align="center" valign="middle" bgcolor="#F9F9F9"><h1><span class="style21 style30"><span class="style30"><strong> Business Permit List</strong></span></span><span class="style2"></span></h1></td>    </center>
            <?php
    $db_name = "business-is";
	$table_name = "personal_info";

	$user = "root";
	$pass = "";
	
	$connection = mysql_connect("localhost","$user","$pass")
	or die(mysql_error());

	$db = mysql_select_db($db_name, $connection) or die(mysql_error());

	$sql = "SELECT * FROM $table_name order by BName";

	$result = mysql_query($sql, $connection) or die(mysql_error());

	$contact_list = "<ul>";

	$num= mysql_num_rows($result);
    $m=0;
	$v;
		
	if($num<1)
	{
		$display_block = "<p><em>Empty...</em> </p>";
	}
	else
	{
	
	$number=0;
	while ($row = mysql_fetch_array($result))

	{   
	    echo "<form name=\"forms\" method=\"post\" action=\"\">";
	    if($row['act']==1)
		{
		$number++;
	    $BID = $row['BID'];
	    $BName = $row['BName'];
		$BAddress = $row['BAddress'];
		$TaxpayerName = $row['TaxpayerName'];
		//<input name=\"$number\" type=\"checkbox\" value=\"$userid\">
	$contact_list.= "<tr><td>&nbsp;<strong>$BID &nbsp;&nbsp;&nbsp;&nbsp; $BName &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $BAddress &nbsp;&nbsp;&nbsp;&nbsp; $TaxpayerName</strong></td><td><a href=\"editApp.php?BID=$BID\">edit</a></td><td><a href='bus_assessment.php?BID=$BID'><img src='images/Report.png' title='Assessment for Business Permit'/></a></td></tr>";
     }
	}

	$contact_list .= "</ul>";
	
	echo "<center><table border=\"2\" cellpadding=\"2\" width=\"800\">";
    echo "<tr><td colspan=\"6\" align=\"left\" background=\"images/img5 - Copy - Copy.jpg\"><strong>Business ID No.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Business Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Business Address &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Owner Name</strong></td></tr>";
	
    for($v=0;$v<=$m;$v++)
	{
	
		
	echo "$contact_list";
	}
    
	
	echo "</table></center>";
	
	//echo "<br><div align=\"center\"><input name=\"deleteall\" type=\"submit\" value=\"DELETE CHECKED\"></form></div>";
		
	}
		
		    
		   
		if(isset($_GET['BID'])) 
		   {
		   echo "<script type=\"text/javascript\">show_confirm();</script>"; 
		   }
		  if(isset($_GET['deleteall']))
		     {
			 $countz;
			 for($countz=1;$countz<=$number;$countz++)
			    {
				$user = "root";
				$pass = "";
	
				$connection = mysql_connect("localhost","$user","$pass")
				or die(mysql_error());

				$db = mysql_select_db($db_name, $connection) or die(mysql_error());
	
				$sql = "DELETE FROM $table_name WHERE BID = '$_POST[$countz]'";

				$result = mysql_query($sql, $connection) or die(mysql_error());
				
				}
			 }
	?>
                 
</div>
        
 

<!-- content ends -->
<!-- footer begins -->
<div id="footer">
  <a href="http://validator.w3.org/check?uri=referer">Copyrights © 2012</a> | <a href="http://guinobatan.gov.ph/index.php/guinobatan/index">Municipality of Guinobatan</a>. | All rights reserved. 
      </p></div>
<!-- footer ends -->
</div>
</div>
</body>
</html>